#!/bin/bash

echo "正在停止并删除现有的RocketMQ容器..."
docker-compose down

echo "正在清理日志目录..."
rm -rf ./logs/*

echo "正在重新启动RocketMQ服务..."
docker-compose up -d

echo "等待服务启动..."
sleep 10

echo "检查服务状态..."
docker-compose ps

echo "检查NameServer日志..."
docker logs rmqnamesrv --tail 20

echo "检查Broker日志..."
docker logs rmqbroker --tail 20

echo "RocketMQ重启完成！"
echo "NameServer地址: 192.168.211.139:9876"
echo "Broker地址: 192.168.211.139:10911"
echo "管理控制台: http://192.168.211.139:8081"

